package com.li.hello.controller.form;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author lixiang
 * @version 1.0
 * @ClassName TestController
 * @Description: Form表单提交demo
 * @date 2019/4/4 10:59
 */
@RestController
public class FormController {

    @RequestMapping("/form1")
    public void form1(@RequestParam String name) {
        System.out.println(name);
    }

    @RequestMapping("/toForm1")
    public ModelAndView toForm1(ModelAndView model) {
        model.setViewName("form/form1");
        return model;
    }
}
